package com.woniuxy01;

import java.util.Scanner;

public class Test04 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        //系统随机数
        int random = (int) (Math.random() * 100);
        System.out.println("random:"+random);
        int num;
        do{
            System.out.println("输入你猜的数字");
            num=scanner.nextInt();
            if(num>random){
                System.out.println("猜大了");
            }else if(num<random){
                System.out.println("猜小了");
            }else{
                System.out.println("猜对了");
                break;
            }
        }while (true);
    }
}
